<?php
/**
 * Created by PhpStorm.
 * User: 戎大富
 * Date: 2019/4/1
 * Time: 16:01
 */
namespace app\admin\controller;
use think\Db;
use think\Request;
class Knowledge extends Base {
    public function index(){
        if(Request::instance()->isPost()){
            $phone = input('phone');
            $res = Db::table('up_sign_config')->where('id', 4)->setField('score', $phone);
            if($res){
                return json(['code' => 200, 'msg' => '编辑成功']);
            }else{
                return json(['code' => 100, 'msg' => '编辑失败']);
            }
        }
        $phone = Db::table('up_sign_config')->where('id', 4)->value('score');
        $this->assign('phone', $phone);
        return $this->fetch();
    }
}